package com.cqc.other.juc.volatil.demo4;

import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class DataEntity {

    private final AtomicInteger count = new AtomicInteger(0);


    public void add() {
        for (int i = 0; i < 1000000; i++) {
            count.getAndIncrement();
        }
    }


    public int getCount() {
        return count.get();
    }
}
